function LinkedList() {
    let Node = function (element) {
        this.element = element;
        this.next = null
    }

    let length = 0
    let head = null

    LinkedList.prototype.append = function (element) {
        var node = new Node(element),
            current;
        
        if (head===null) {
            head = node
        }else {
            current = head

            while(current.next) {
                current = current.next
            }
            // 找到最后一项，将其next赋为element
            current.next = node
        }
        length++
    }
}

let list = new LinkedList()
list.append(15)
list.append(10)

console.log(list.head);
